package cn.ilikes.tools.nosql.jpa.metadatas.elements;

import cn.ilikes.tools.nosql.jpa.JPASQLRunTimeException;

/**
 * public @interface Column {
 * String name() default "";
 * boolean unique() default false;
 * boolean nullable() default true;
 * boolean insertable() default true;
 * boolean updatable() default true;
 * String columnDefinition() default "";
 * String table() default "";
 * int length() default 255;
 * int precision() default 0;
 * int scale() default 0;
 * }
 * 
 * @author fack
 * 
 */
public class JPAColumn {

	private String columnName;

	private boolean ableColumn = false;

	public JPAColumn(String columnName) {
		super();
		this.columnName = columnName;
		ableColumn = true;
	}

	public JPAColumn(boolean ableColumn) {
		if (ableColumn)
			throw new JPASQLRunTimeException("not set ableColumn = true ! plase use   JPAColumn(String columnName)  ! ");
		this.ableColumn = ableColumn;
	}

	public String getColumnName() {
		return columnName;
	}

	public boolean isAbleColumn() {
		return ableColumn;
	}

}
